package com.level2app.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.QuickViewHolder;
import com.level2app.R;

/*
 * Author: S
 * Date: 2024/9/5
 */public class TransactionsAdapter extends BaseQuickAdapter<String, QuickViewHolder> {

    @Override
    protected void onBindViewHolder(@NonNull QuickViewHolder holder, int i, @Nullable String bean) {
        holder.setText(R.id.titleTv, "Hotel/Brand Name");
        holder.setText(R.id.desTv, "Description");
        // 金额颜色，深色：color_344054（344054），浅色：color_9ca3af（9CA3AF）
        holder.setText(R.id.moneyTv, "+ $3.88");
        Glide.with(getContext()).load("https://img2.baidu.com/it/u=1237025922,2679733234&fm=253&fmt=auto&app=120&f=JPEG?w=749&h=500").into((ImageView) holder.getView(R.id.headIv));
    }

    @NonNull
    @Override
    protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
        return new QuickViewHolder(R.layout.item_transactions, viewGroup);
    }
}